<?php
	include_once 'isLogin.php';
	$order_id = $_GET['id'];

	$orderc = new order($pagec);
	
	$where = ' AND o.id = "' . $order_id . '"';
	$row = $orderc->orderInfo($sql , 'o.*');
	
	$refund = $orderc->refundInfo($order_id , '*' , 'order_id');
	$row['refund_info'] = $refund;
	
	$smarty->assign('row',$row);
	
	if($_POST['submit'] != ''){
		$check = $_POST['check'];
		$refund_cash = $_POST['refund_cash'];

		if($check == 'y'){
			//待退款
			$res = $orderc->orderUpdate(array('trading_status' => 5) , ' id ="'.$order_id.'"');
			if($res){
				$orderc->refundUpdate(array('refund_cash' => $refund_cash) , ' id ="'.$refund['id'].'"');
			}
		}
		$msg = '审核完成';
		$url = 'order_list.php';
		
		$commonc->submitAlert($msg , $url);
		exit();
	}
	
	$smarty->display($_filename.".html");
	
?>